package com.cvte.shop.generator.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cvte.shop.generator.entity.SysGenerator;
import com.cvte.shop.generator.mapper.SysGeneratorMapper;
import com.cvte.shop.generator.service.ISysGeneratorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author
 * @since 2019-04-15
 */
@Service
public class SysGeneratorServiceImpl extends ServiceImpl<SysGeneratorMapper, SysGenerator> implements ISysGeneratorService {

    @Autowired
    private SysGeneratorMapper generatorMapper;

    @Override
    public List<String> getTables() {
        return generatorMapper.getTables();
    }

    @Override
    public IPage<SysGenerator> selectPageList(IPage<SysGenerator> page) {
        List<SysGenerator> list = generatorMapper.selectPageList(page);
        page.setRecords(list);
        page.setTotal(list.size());
        return page;
    }

    @Override
    public void insertGenerarot(SysGenerator sysGenerator) {
        generatorMapper.insertGenerarot(sysGenerator);
    }

    @Override
    public SysGenerator selectGeneratorById(String id) {
        return generatorMapper.selectGeneratorById(id);
    }

    @Override
    public void updateGeneratorById(SysGenerator sysGenerator) {
        generatorMapper.updateGeneratorById(sysGenerator);
    }

    @Override
    public void deleteGeneratorById(String id) {
        generatorMapper.deleteGeneratorById(id);
    }


}
